//添加内容
var addhtml = ''
addhtml += '<div class="form-div"><form id="fomr">';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">编号</label><div class="layui-input-block"><input type="text" name="mid" autocomplete="off" placeholder="不可编辑" class="layui-input"></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">大区</label><div class="layui-input-block"><select name="area" lay-ignore class="layui-input  member-area"></select></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">等级</label><div class="layui-input-block"><select name="level_id" lay-ignore class="layui-input   level-input"></select></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">类型</label><div class="layui-input-block"><select name="type" lay-ignore class="layui-input   member-type"></select></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">推荐人</label><div class="layui-input-block"><input type="text" name="inviter_id" autocomplete="off" class="layui-input" placeholder="请输入推荐人" ></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">安置人</label><div class="layui-input-block"><input type="text" name="seter_id" autocomplete="off" class="layui-input" placeholder="请输入安置人"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">代理中心</label><div class="layui-input-block"><input type="text" name="agent_id" autocomplete="off" class="layui-input" placeholder="请输入代理中心"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">姓名</label><div class="layui-input-block"><input type="text" name="mname" autocomplete="off" class="layui-input" placeholder="请输入您真实姓名"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">登录密码</label><div class="layui-input-block"><input type="password" name="password" value="123456" autocomplete="off" class="layui-input" placeholder="请输入登录密码"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">确定密码</label><div class="layui-input-block"><input type="password" name="rpassword" value="123456" autocomplete="off" class="layui-input" placeholder="请再次输入登录密码"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">安全密码</label><div class="layui-input-block"><input type="password" name="safe_password" value="123456" autocomplete="off" class="layui-input" placeholder="请输入安全密码"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">确定密码</label><div class="layui-input-block"><input type="password" name="rsafe_password" value="123456" autocomplete="off" class="layui-input" placeholder="请再次输入安全密码"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">手机</label><div class="layui-input-block"><input type="tel" name="phone" autocomplete="off" class="layui-input" placeholder="请输入您的手机号码"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">身份证</label><div class="layui-input-block"><input type="text" name="idcard" autocomplete="off" class="layui-input" placeholder="请输入您的身份证"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">邮编</label><div class="layui-input-block"><input type="tel" name="postcode" autocomplete="off" class="layui-input" placeholder="请输入邮编"></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">省份</label><div class="layui-input-block"><select lay-ignore class="layui-input" id="prov" onchange="cityFun($(this))"></select></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">市/直辖市</label><div class="layui-input-block"><select lay-ignore class="layui-input" id="city" onchange="townFun($(this))"></select></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">区域</label><div class="layui-input-block"><select lay-ignore class="layui-input"name="city" id="town"></select></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">地址</label><div class="layui-input-block"><input type="text" name="address" autocomplete="off" class="layui-input" placeholder="请输入街道名称门牌号"></div></div>';
addhtml +='<div class="layui-form-item"><label class="layui-form-label">备注</label><div class="layui-input-block"><input type="text" name="remark" autocomplete="off" class="layui-input"></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">全体分红</label><div class="layui-input-block"><select lay-ignore class="layui-input" name="is_world"><option value="1">是</option><option value="0">否</option></select></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">代理中心</label><div class="layui-input-block"><select lay-ignore class="layui-input" name="is_agent"><option value="0">否</option><option value="1">是</option></select></div></div>';
addhtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">加权分红</label><div class="layui-input-block"><select lay-ignore class="layui-input" name="is_share"><option value="1">是</option><option value="0">否</option></select></div></div>';
addhtml += '<input type="hidden" name="token" value="' + token + '">';
addhtml += '</form></div>';

//编辑内容
var edithtml = ''
edithtml += '<div class="form-div"><form id="fomr">';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">编号</label><div class="layui-input-block"><input type="text" name="mid" autocomplete="off" placeholder="不可编辑" class="layui-input" readonly="readonly" ></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">大区</label><div class="layui-input-block"><select name="area" lay-ignore class="layui-input  member-area"  disabled="disabled"></select></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">等级</label><div class="layui-input-block"><select name="level_id" lay-ignore class="layui-input   level-input" disabled="disabled"></select></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">类型</label><div class="layui-input-block"><select name="type" lay-ignore class="layui-input   member-type" disabled="disabled"></select></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">推荐人</label><div class="layui-input-block"><input type="text" name="inviter_id" autocomplete="off" class="layui-input" placeholder="请输入推荐人" readonly="readonly" ></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">安置人</label><div class="layui-input-block"><input type="text" name="seter_id" autocomplete="off" class="layui-input" placeholder="请输入安置人" readonly="readonly" ></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">代理中心</label><div class="layui-input-block"><input type="text" name="agent_id" autocomplete="off" class="layui-input" placeholder="请输入代理中心" readonly="readonly" ></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">姓名</label><div class="layui-input-block"><input type="text" name="mname" autocomplete="off" class="layui-input" placeholder="请输入您真实姓名"></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">手机</label><div class="layui-input-block"><input type="tel" name="phone" autocomplete="off" class="layui-input" placeholder="请输入您的手机号码"></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">身份证</label><div class="layui-input-block"><input type="text" name="idcard" autocomplete="off" class="layui-input" placeholder="请输入您的身份证"></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">邮编</label><div class="layui-input-block"><input type="tel" name="postcode" autocomplete="off" class="layui-input" placeholder="请输入邮编"></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">省份</label><div class="layui-input-block"><select lay-ignore class="layui-input" id="prov" onchange="cityFun($(this))"></select></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">市/直辖市</label><div class="layui-input-block"><select lay-ignore class="layui-input" id="city" onchange="townFun($(this))"></select></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">区域</label><div class="layui-input-block"><select lay-ignore class="layui-input"name="city" id="town"></select></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">地址</label><div class="layui-input-block"><input type="text" name="address" autocomplete="off" class="layui-input" placeholder="请输入街道名称门牌号"></div></div>';
edithtml +='<div class="layui-form-item"><label class="layui-form-label">备注</label><div class="layui-input-block"><input type="text" name="remark" autocomplete="off" class="layui-input"></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">全体分红</label><div class="layui-input-block"><select lay-ignore class="layui-input" name="is_world"><option value="0" disabled="disabled">否</option><option value="1">是</option></select></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">代理中心</label><div class="layui-input-block"><select lay-ignore class="layui-input" name="is_agent"><option value="0" disabled="disabled">否</option><option value="1">是</option></select></div></div>';
edithtml +='<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">加权分红</label><div class="layui-input-block"><select lay-ignore class="layui-input" name="is_share"><option value="0" disabled="disabled">否</option><option value="1">是</option></select></div></div>';
edithtml += '<input type="hidden" name="token" value="' + token + '">';
edithtml += '<input type="hidden" name="id">';
edithtml += '</form></div>';

//增减货币内容

var curhtml = ''
curhtml += '<div class="form-div"><form id="fomr">';
curhtml += '<div class="layui-form-item"><label class="layui-form-label">会员编号</label><div class="layui-input-block"><input type="text" name="mid" autocomplete="off" class="layui-input" readonly="readonly"></div></div>';
curhtml += '<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">操作</label><div class="layui-input-block"><select name="type" lay-ignore class="layui-input   member-is-agent"><option value="inc">增加</option><option value="dec">减少</option></select></div></div>';
curhtml += '<div class="layui-form-item layui-form-select-icon iconfont"><label class="layui-form-label">货币</label><div class="layui-input-block"><select name="coin_id" lay-ignore class="layui-input   cion-type"></select></div></div>';
curhtml += '<div class="layui-form-item"><label class="layui-form-label">金额</label><div class="layui-input-block"><input type="text" name="amount" autocomplete="off" class="layui-input"></div></div>';
curhtml += '<div class="layui-form-item"><label class="layui-form-label">备注</label><div class="layui-input-block"><input type="text" name="explain" autocomplete="off" class="layui-input"></div></div>';
curhtml += '<input type="hidden" name="token" value="' + token + '">';
curhtml += '<input type="hidden" name="id">';
curhtml += '</form></div>';

//密码
var pashtml = ''
pashtml += '<div class="form-div"><form id="fomr">';
pashtml +='<div class="layui-form-item"><label class="layui-form-label">登录密码</label><div class="layui-input-block"><input type="password" name="password" autocomplete="off" class="layui-input" placeholder="请输入登录密码"></div></div>';
pashtml +='<div class="layui-form-item"><label class="layui-form-label">安全密码</label><div class="layui-input-block"><input type="password" name="safe_password" autocomplete="off" class="layui-input" placeholder="请输入安全密码"></div></div>';
pashtml += '<input type="hidden" name="token" value="' + token + '">';
pashtml += '<input type="hidden" name="id">';
pashtml += '</form></div>';

layui.use('table', function() {
	var table = layui.table;
	
	table.on('checkbox(table)', function(obj){
		var checkStatus = table.checkStatus('idTest'),data = checkStatus.data;
         if(data.length>0){
         	$(".center-nav a.hb-bnt").removeClass("hov-n").addClass("hov");
         }else{
         	$(".center-nav a.hb-bnt").removeClass("hov").addClass("hov-n");
         }
     });
	
	
	var $ = layui.$, active = {
		
		reload: function() {
			var csLoding=layer.msg('数据加载中...', {
				icon: 16,
				shade: 0.3,
				success: function() {
					var mid = $('#mid').val();
					var mname = $('#mname').val();
					var level_id = $("#level_id option:selected").val();
					var type = $("#type option:selected").val();
					var agent_mid = $('#agent_mid').val();
					var inviter_mid = $('#inviter_mid').val();
					var seter_mid = $('#seter_mid').val();
					var is_agent = $("#is_agent option:selected").val();
					var start = $('#start').val();
					var end = $('#end').val();
		
					//执行重载
					table.reload('idTest', {
						page: {
							curr: 1 //重新从第 1 页开始
						},
						where: {
							key: {
								mid:mid,
								mname:mname,
								level_id:level_id,
								type:type,
								agent_mid:agent_mid,
								inviter_mid:inviter_mid,
								seter_mid:seter_mid,
								is_agent:is_agent,
								start: start,
								end: end
							}
						},
						done: function(){
						     layer.close(csLoding)
						}
					});
				}
			})
			
		},
	 	dis: function(){
	      var checkStatus = table.checkStatus('idTest'),data = checkStatus.data;
	      var myArray = new Array();
			for(var i = 0; i < data.length; i++) {
				myArray.push(data[i].id)
			}
			layer.alert('您确定要禁用该会员！', {
				icon: 2,
				btn: ['确定', '关闭'],
				btn1: function() {
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: disSrc,
						data: {
							token: token,
							data: myArray
						},
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			})
	    },
	    fora: function(){
	       var checkStatus = table.checkStatus('idTest'),data = checkStatus.data;
	       var myArray = new Array();
			for(var i = 0; i < data.length; i++) {
				myArray.push(data[i].id)
			}
			layer.alert('您确定要冻结该会员！', {
				icon: 2,
				btn: ['确定', '关闭'],
				btn1: function() {
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: forSrc,
						data: {
							token: token,
							data: myArray
						},
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			})
	    }
	 }
	 $('.right-center .right-btn').on('click', function(){
	    var type = $(this).data('type');
	    active[type] ? active[type].call(this) : '';
	});
	
	$('.right-center #ScreenBnt').on('click', function() {
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});
	
	
	
	var csLoding=layer.msg('数据加载中...', {
		icon: 16,
		shade: 0.3,
		success: function() {
			table.render({
				elem: '#centet-cen',
				url: listSrc,
				height: $(".center-tab").height(),
				id:'idTest',
				response: {
		  			statusCode: 1, //成功的状态码，默认：0
				},
				page:true,
				cols: [
					[ //标题栏
						{
							type: 'checkbox'
						},
						{
							field: 'id',
							title: 'ID'
						}, {
							field: 'mid',
							title: '用户编号'
						}, {
							field: 'mname',
							title: '姓名'
						}, {
							field: 'floor',
							title: '层数'
						}, {
							field: 'area_remark',
							title: '大区'
						}, {
							field: 'type_remark',
							title: '类型'
						}, {
							field: 'status_remark',
							title: '状态'
						}, {
							field: 'level_name',
							title: '当前等级'
						}, {
							field: 'init_level_name',
							title: '最初等级'
						}, {
							field: 'inviter_mid',
							title: '推荐人'
						}, {
							field: 'seter_mid',
							title: '安置人'
						}, {
							field: 'agent_mid',
							title: '代理中心'
						}, {
							field: 'oper',
							title: '操作',
							width: 300,
							minWidth: 160,
							toolbar: '#barDemo'
						}
	
					]
				],
				limit: 20,
				done: function(){
				     layer.close(csLoding)
				}
			});
			
		}
		
		
	})

	table.on('tool(table)', function(obj) {
		var data = obj.data;
		if(obj.event === 'detail') {
			var mid = data.mid;
			$.ajax({
				type: 'post',
				dataType: 'json',
				url: seeSrc,
				data: {
					mid: mid
				},
				success: function(data) {
					var code = data.code;
					var msg = data.msg;
					var data = data.data;
					if(code == 1) {
						layer.open({
							title: "查看会员详情",
							type: 1,
							skin: 'layui-layer-rim',
							area: ['420px', '500px'],
							content: '<div class="see-index"><ul><li><span>会员编号：</span>' + data.mid + '</li><li><span>大区：</span>' + data.area_remark + '</li><li><span>等级：</span>' + data.init_level_name +
								'</li><li><span>类型：</span>' + data.type_remark + '</li><li><span>推荐人：</span>' + data.inviter_id + '</li><li><span>安置人：</span>' + data.seter_id + '</li><li><span>代理中心：</span>' + data.agent_id + '</li><li><span>姓名：</span>' + data.mname + '</li><li><span>手机：</span>' + data.phone + '</li><li><span>身份证：</span>' + data.idcard + '</li><li><span>邮编：</span>' + data.postcode + '</li><li><span>地址：</span>' + data.address + '</li><li><span>备注：</span>' + data.remark + '</li><li><span>开启全体分红：</span>' + data.is_world + '</li><li><span>开启代理中心：</span>' + data.is_agent_remark + '</li><li><span>开启加权分红：</span>' + data.is_share + '</li></ul></div>',
						});
					}

				}
			})
		} else if(obj.event === 'cur') {
			var id = data.id;
			var mid = data.mid;
			layer.open({
				type: 1,
				title: "货币增减",
				area: ['550px', '400px'], //宽高
				maxmin: true,
				resize: true,
				content: curhtml,
				btn: ['提交', '关闭'],
				btn1: function() {
					var Adata = $("#fomr").serialize();
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: curSrc,
						data: Adata,
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			});
			$("#fomr input[name=mid]").val(mid);
			$("#fomr input[name=id]").val(id);
			$("#fomr select.cion-type").html($("#cionHtml").html());
		} else if(obj.event === 'del') {
			var id = data.id;
			layer.alert('您确定要删除该会员！',{
				icon: 2,
				btn: ['确定', '关闭'],
				btn1: function() {
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: delSrc,
						data: {
							token: token,
							id: id
						},
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			})
		} else if(obj.event === 'pass') {
			layer.open({
				type: 1,
				title: "修改密码",
				area: ['550px', '190px'], //宽高
				maxmin: true,
				resize: true,
				content: pashtml,
				btn: ['提交', '关闭'],
				btn1: function() {
					var Adata = $("#fomr").serialize();
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: pasSrc,
						data: Adata,
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			});
			$("#fomr input[name=id]").val(data.id);
		} else if(obj.event === 'edit') {
			var mid = data.mid;
			$.ajax({
				type: 'post',
				dataType: 'json',
				url: seeSrc,
				data: {
					mid: mid
				},
				success: function(data) {
					var address_province = data.data.address_province;
					var address_citye = data.data.address_city;
					var address_county = data.data.address_county;
					var code = data.code;
					var msg = data.msg;
					if(code == 1) {
						layer.open({
							title: "编辑会员",
							type: 1,
							skin: 'layui-layer-rim',
							area: ['550px', '550px'],
							content: edithtml,
							btn: ['提交', '关闭'],
							btn1: function() {
								var Adata = $("#fomr").serialize();
								$.ajax({
									type: 'post',
									dataType: 'json',
									url: editSrc,
									data: Adata,
									success: function(data) {
										var code = data.code;
										var msg = data.msg;
										if(code == 1) {
											layer.close(layer.index)
											layer.alert(msg, {
												icon: 1
											}, function() {
												location.reload();
											})
										} else {
											layer.alert(msg, {
												icon: 5
											})
										}
									}
								})
							}
						});
						$("#fomr select.member-area").html($("#areaHtml").html());
						$("#fomr select.level-input").html($("#levelHtml").html());
						$("#fomr select.member-type").html($("#typeHtml").html());
						$("#fomr select.member-is-agent").html($("#agentHtml").html());
						$("#fomr").formEdit(data.data);
						$.ajax({
							type: "get",
							url: cryApi,
							success: function(data) {
								listHtml = '<option value="">请选择</option>'
								$.each(data, function(index, value) {
									listHtml += '<option value="' + value.id + '">' + value.name + '</option>';
								});
								$("#prov").html(listHtml);
								for(var i = 0; i < $("#prov option").length; i++) {
									if($("#prov option").eq(i).val() == address_province) {
										$("#prov option").eq(i).attr("selected", "selected");
									}
								}
							}
						});
						$.ajax({
							type: "get",
							url: cryApi,
							data: {
								id: address_province
							},
							success: function(data) {
								listHtml = '<option value="">请选择</option>'
								$.each(data, function(index, value) {
									listHtml += '<option value="' + value.id + '">' + value.name + '</option>';
								});
								$("#city").html(listHtml);
								for(var i = 0; i < $("#city option").length; i++) {
									if($("#city option").eq(i).val() == address_citye) {
										$("#city option").eq(i).attr("selected", "selected");
									}
								}
							}
						});
						$.ajax({
							type: "get",
							url: cryApi,
							data: {
								id: address_citye
							},
							success: function(data) {
								listHtml = '<option value="">请选择</option>'
								$.each(data, function(index, value) {
									listHtml += '<option value="' + value.id + '">' + value.name + '</option>';
								});
								$("#town").html(listHtml);
								for(var i = 0; i < $("#town option").length; i++) {
									if($("#town option").eq(i).val() == address_county) {
										$("#town option").eq(i).attr("selected", "selected");
									}
								}
							}
						});
					} else {
						layer.alert(msg, {
							icon: 5
						})
					}
				}
			});
		}
	});
	
	
	
	
})

layui.use('layer', function() {
	var $ = layui.jquery,
		layer = layui.layer;
	var active = {
		add: function() {
			layer.open({
				type: 1,
				title: "新增会员",
				area: ['550px', '550px'], //宽高
				maxmin: true,
				resize: true,
				content: addhtml,
				btn: ['提交', '关闭'],
				btn1: function() {
					var Adata = $("#fomr").serialize();
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: addSrc,
						data: Adata,
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			});
			$("#fomr select.member-area").html($("#areaHtml").html());
			$("#fomr select.level-input").html($("#levelHtml").html());
			$("#fomr select.member-type").html($("#typeHtml").html());
			$("#fomr select.member-is-agent").html($("#agentHtml").html());
			provFun();
		}
	}
	$('.right-center').on('click', '.right-btn', function() {
		var othis = $(this),method = othis.data('method');
		active[method] ? active[method].call(this, othis) : '';
	});
})

layui.use(['form', 'layedit', 'laydate'], function(){
	 var form = layui.form,layer = layui.layer,layedit = layui.layedit,laydate = layui.laydate;
	laydate.render({
		elem: '#start'
	});
	laydate.render({
		elem: '#end'
	});
})


$(function() {
	//会员等级
	levelFun();
	//会员状态
	statusFun();
	//所在大区
	areaFun();
	//是否代理中心
	agentFun();
	//会员类型
	typeFun();
	//货币类型
	cionFun();

	$('#screen-form').formEdit(seet);

	$("#Expbnt").click(function() {
		$("#screen-form").attr("action", ExpSrc);
	})

})